#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int count = 0;
	int n = 0;
	scanf("%d", &n);

	while (n)
	{		
		n = n & (n - 1);
		count++;		
	}

	printf("%d", count);
	return 0;
}